package kata09.info;

import kata09.discount.IGoodsDiscountStrategy;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 商品
 */
@Data
public class Goods {
    //商品
    private GoodsInfo goods;
    //商品折扣
    private GoodsDiscount goodsDiscount;

    private Goods(){}

    public Goods(String name, BigDecimal price, String discountName, IGoodsDiscountStrategy goodsDiscountStrategy){
        GoodsInfo goodsInfo = new GoodsInfo(name,price);
        this.goods = goodsInfo;
        GoodsDiscount discount = new GoodsDiscount(discountName,goodsDiscountStrategy);
        this.goodsDiscount = discount;
    }
}
